<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" 
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
                    
                xmlns:f="http://xmlns.jcp.org/jsf/core">

        <h2>Obras en ejecucion</h2>
        <h:dataTable id="tblListaObras"   value="#{obraController.listaObras}" var="obr"
    			styleClass="order-table"                        
    			headerClass="order-table-header"
    			rowClasses="order-table-odd-row,order-table-even-row"
    		>
 
    			<h:column>
    				<f:facet name="header">Nombre Obra</f:facet>
                                <h:commandLink value="#{obr.nombre}" action="#{obraController.editar}">
                                    <f:setPropertyActionListener target="#{obraController.obra}" value="#{obr}" />
                                    <f:ajax render=":frm2:panelDatosObra" />
                                </h:commandLink> 
    			</h:column>
 
    			<h:column>
    				<f:facet name="header">Direccion</f:facet>
    				#{obr.direccion} 
    			</h:column>
 
    			<h:column>
    				<f:facet name="header">Lat / Long </f:facet>
    				#{obr.latitud} - #{obr.longitud} 
    			</h:column>
    		</h:dataTable>
    <div>
        <h:commandButton value="Nuevo" action="#{obraController.nuevo()}">
            <f:ajax execute="@this" render=":frm2:panelDatosObra"  />
        </h:commandButton>
        <h:commandButton value="Borrar" action="#{obraController.borrar()}">
            <f:ajax render="tblListaObras" />
        </h:commandButton>
    </div>

</ui:composition>